<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Template • TodoMVC</title>
    <link rel="stylesheet" href="node_modules/todomvc-common/base.css">
    <link rel="stylesheet" href="node_modules/todomvc-app-css/index.css">
    <!-- CSS overrides - remove if you don't need it -->
    <link rel="stylesheet" href="css/app.css">
    <style>
        .toggle:checked:after {
            content: ''!important;
            display: block;
            width: 20px;
            height: 20px;
            margin: 10px auto 0;
            background: url('./img/success-ico.png') no-repeat scroll center center;
        }
    </style>
</head>

<body>
    <section class="todoapp" id="app">
        <header class="header">
            <h1>todos</h1>
            <input class="new-todo" placeholder="What needs to be done?" autofocus @keydown="enterDown" v-model.trim="userInput">
        </header>
        <!-- This section should be hidden by default and shown when there are todos -->
        <section class="main">
            <input id="toggle-all" class="toggle-all" type="checkbox" @key>
            <label for="toggle-all">Mark all as complete</label>
            <ul class="todo-list">
                <!-- These are here just to show the structure of the list items -->
                <!-- List items should get the class `editing` when editing and `completed` when marked as completed -->
                <!-- <li class="completed">
                    <div class="view">
                        <input class="toggle" type="checkbox" checked>
                        <label>Taste JavaScript</label>
                        <button class="destroy"></button>
                    </div>
                    <input class="edit" value="Create a TodoMVC template">
                </li>
                <li>
                    <div class="view">
                        <input class="toggle" type="checkbox">
                        <label>Buy a unicorn</label>
                        <button class="destroy"></button>
                    </div>
                    <input class="edit" value="Rule the web">
                </li> -->
                <li v-for="(item,index) in list" :key="item.id" :class="{ completed: item.ischecked,editing:item.id==editFlag }">
                    <div class="view">
                        <input class="toggle" type="checkbox" @change="finish(item.id)">
                        <label @dblclick="doubleClick(item.id)">{{ item.userInput }}</label>
                        <button class="destroy" @click="destroy(index)"></button>
                    </div>
                    <input class="edit" v-model="item.userInput" @keyup.enter="enterUp">
                </li>
            </ul>
        </section>
        <!-- This footer should hidden by default and shown when there are todos -->
        <footer class="footer" v-show="canShowFooter">
            <!-- This should be `0 items left` by default -->
            <span class="todo-count"><strong>{{ theItems }}</strong> item left</span>
            <!-- Hidden if no completed items are left ↓ -->
            <button class="clear-completed" @click="clearComplete" v-show="canShowClCom">Clear completed</button>
        </footer>
    </section>

    <!-- Scripts here. Don't remove ↓ -->
    <script src="node_modules/todomvc-common/base.js"></script>
    <!-- 引入vue -->
    <script src="./node_modules/vue/dist/vue.js"></script>
    <!-- app.js一个臭沙箱 -->
    <script src="js/app.js"></script>
</body>

</html>